package com.eedi.framework.permission.controller.sys.vo.menu;

import com.eedi.framework.common.enums.YesOrNoEnum;
import com.eedi.framework.permission.enums.SysMenuTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import com.eedi.framework.common.enums.CommonStatusEnum;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Schema(description = "系统界面 - 菜单创建/修改 Request VO")
@Data
public class SysMenuSaveReq {

    @Schema(description = "菜单编号", example = "1024")
    private String sysMenuId;

    @Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "永聚长青")
    @NotBlank(message = "菜单名称不能为空")
    @Size(max = 50, message = "菜单名称长度不能超过50个字符")
    private String sysMenuName;

    @Schema(description = "权限标识,仅菜单类型为按钮时，才需要传递", example = "sys:menu:add")
    @Size(max = 100)
    private String sysMenuPermission;

    @Schema(description = "类型，参见 MenuTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "菜单类型不能为空")
    private SysMenuTypeEnum sysMenuType;

    @Schema(description = "显示顺序不能为空", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @NotNull(message = "显示顺序不能为空")
    private Integer sysMenuSort;

    @Schema(description = "父菜单 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @NotNull(message = "父菜单 ID 不能为空")
    private String parentSysMenuId;

    @Schema(description = "路由地址,仅菜单类型为菜单或者目录时，才需要传", example = "post")
    @Size(max = 200, message = "路由地址不能超过200个字符")
    private String sysMenuPath;

    @Schema(description = "菜单图标,仅菜单类型为菜单或者目录时，才需要传", example = "/menu/list")
    private String sysMenuIcon;

    @Schema(description = "组件路径,仅菜单类型为菜单时，才需要传", example = "system/post/index")
    @Size(max = 200, message = "组件路径不能超过255个字符")
    private String sysMenuComponent;

    @Schema(description = "组件名", example = "SystemUser")
    private String sysMenuComponentName;

    @Schema(description = "状态,见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "状态不能为空")
    private CommonStatusEnum sysMenuStatus;

    @Schema(description = "是否可见,见 YesOrNoEnum 枚举", example = "1")
    private YesOrNoEnum sysMenuVisible;

    @Schema(description = "是否缓存,见 YesOrNoEnum 枚举", example = "0")
    private YesOrNoEnum sysMenuKeepAlive;

    @Schema(description = "是否总是显示,见 YesOrNoEnum 枚举", example = "0")
    private YesOrNoEnum sysMenuAlwaysShow;

}
